Skip to content

Conversation

@MinuraPunchihewa
Copy link
Contributor

@MinuraPunchihewa MinuraPunchihewa commented Jul 31, 2025

This PR adds the missing skills_extra_parameters attribute to the Agents collection within the SDK.
This attribute contains critical information for Minds such as the tables that a given Mind will have access to through the skills associated with it.

Here is an example of an Agent returned via the REST API containing this parameter:

  {
    "id": 12,
    "name": "test_mind",
    "project_id": 2,
    "updated_at": "2025-07-31 06:31:32.655395",
    "created_at": "2025-07-31 06:31:32.262213",
    "model_name": "gpt-4o",
    "provider": "openai",
    "skills": [
      {
        "id": 12,
        "name": "snowflake_ds",
        "project_id": 2,
        "agent_ids": [11, 12],
        "type": "sql",
        "params": {
          "database": "snowflake_ds",
          "tables": [],
          "description": "Snowflake data"
        },
        "created_at": "2025-07-30 13:21:43.352626"
      }
    ],
    "skills_extra_parameters": {
      "snowflake_ds": {
        "tables": [
          "table_1",
          "table_2"
        ]
      }
    },
    "params": {
      "prompt_template": "..."
    }
  }

@entelligence-ai-pr-reviews
Copy link

Review Summary

🏷️ Draft Comments (1)

Skipped posting 1 draft comments that were valid but scored below your review threshold (>13/15). Feel free to update them here.

mindsdb_sdk/agents.py (1)

85-90: Using mutable default arguments (skills, data, params, skills_extra_parameters) in Agent.__init__ can cause shared state across instances, leading to data corruption and unpredictable behavior.

📊 Impact Scores:

  • Production Impact: 4/5
  • Fix Specificity: 5/5
  • Urgency Impact: 3/5
  • Total Score: 12/15

🤖 AI Agent Prompt (Copy & Paste Ready):

In mindsdb_sdk/agents.py, lines 85-90, the Agent.__init__ method uses mutable default arguments (lists and dicts), which can cause shared state and data corruption between Agent instances. Change all default arguments for skills, data, params, and skills_extra_parameters to None, and in the body, set them to empty list/dict if None. Update the assignments accordingly to avoid shared mutable defaults.

@github-actions
Copy link

github-actions bot commented Jul 31, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mindsdb_sdk
   agents.py2176769%30, 106, 109, 112, 115, 123, 131, 151, 172, 183, 186, 190, 192, 194, 196, 198, 200, 202, 204, 206, 213, 277, 290, 301, 312, 315–319, 334, 343–347, 391, 399–400, 458, 466–467, 471, 501–509, 517–519, 521–522, 548–561, 573–574, 576
   databases.py49296%118, 146
   handlers.py39197%77
   jobs.py97793%40, 52, 80, 84, 146–149
   knowledge_bases.py1331886%70–73, 132–136, 160, 189, 196, 200–202, 206, 228–232, 242
   ml_engines.py42393%94, 126, 128
   models.py2101991%109, 140–141, 222, 231, 233, 303, 339, 348, 372, 397, 491, 499, 518, 534, 542, 567, 571, 584
   projects.py63198%160
   query.py13192%14
   skills.py53983%43, 45, 49, 58–60, 76–80, 122
   tables.py1301588%140–142, 145, 165, 192, 203–204, 209, 224, 227, 321, 342–347, 356, 376
   views.py37295%105, 138
mindsdb_sdk/connectors
   rest_api.py2645280%19–29, 35–36, 51, 55, 58–59, 79–81, 102, 105, 112–115, 148–156, 177–178, 213–216, 230–231, 285–290, 294–306
mindsdb_sdk/utils
   agents.py50492%72, 79–81
   mind.py47470%1–128
   openai.py853065%37–40, 83–85, 107, 148–158, 215–216, 234–240, 258–276
   table_schema.py21210%1–54
TOTAL165829982% 

Tests Skipped Failures Errors Time
31 0 💤 0 ❌ 0 🔥 10.811s ⏱️

@entelligence-ai-pr-reviews
Copy link

Review Summary

@MinuraPunchihewa MinuraPunchihewa requested a review from StpMax July 31, 2025 08:01
@github-project-automation github-project-automation bot moved this from to review to approved in Tracking PRs Jul 31, 2025
@MinuraPunchihewa MinuraPunchihewa merged commit d7e20a7 into main Aug 11, 2025
6 checks passed
@MinuraPunchihewa MinuraPunchihewa deleted the bugfix/add_skills_extra_params_to_agent branch August 11, 2025 06:16
@github-project-automation github-project-automation bot moved this from approved to merged in Tracking PRs Aug 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: merged

Development

Successfully merging this pull request may close these issues.

3 participants